<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
   
</head>
<body>
    <div>
        <img src="images/mi.png" alt="" id="logo">
    </div>
    <script>
        var imgs=["images/mi.png","images/fei.png","images/baby.png","images/yan.png"];
        var i=1;
        function show(){
            var logo=document.getElementById("logo");//获取图片的DOM对象
            logo.src=imgs[i];//imgs[1]  imgs[2]  imgs[3] imgs[0]  imgs[1]  imgs[2]  imgs[3]
            if(i==3){//说明展示为最后一张
                i=0;
            }else{
                i++;//2  3  0   1
            }
           
           

        }
        setInterval(show,1000);
    </script>
</body>
</html>